package com.foreknow.springboot.mapper;

import com.foreknow.springboot.po.Orderdetailet;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.sql.SQLException;
import java.util.List;

@Mapper
public interface OrderdetailetMapper {
    /**
     * 根据用户编号、商家编号从购物车表中查询所有数据，批量添加到订单明细表中，
     * @param list
     * @return
     */
    public int saveOrderdetailet(List<Orderdetailet> list);

    /**
     * 根据 orderId 查
     * @param orderId
     * @return
     * @throws SQLException
     */
    @Select("SELECT * FROM orderdetailet,food WHERE orderdetailet.foodId = food.foodId AND orderId = #{orderId}")
    public List<Orderdetailet> listOrderdetailet(Integer orderId);
}
